<template>
  <!--LPN明细-->
  <div id="AcquireDataDetails">
    <v-table
      :checked="false"
      :pageSize="pageSize"
      :page="page"
      :searchFlag="false"
      :tableConfig="tableConfig"
      :tableData="tableData"
      :total="total"
      @getTableData="getTableData"
      @upData="getTableData"
    ></v-table>
  </div>
</template>

<script>
    import table from 'commons/Table'
    import baseMixin from "@/mixins/BaseMixin";

    export default {
        name: "AcquireDataDetails",
        mixins: [baseMixin],
        props: {
            data: {
                type: Object
            }
        },
        data() {
            return {
                tableConfig: [
                    {label: this.$t('outbound.userlinenumber'), prop: "sourcelinenumber"},
                    {label: this.$t('in.lot'), prop: "lot"},
                    {label: this.$t('in.lpn'), prop: "id"},
                    {label: this.$t('in.caseid'), prop: "caseid"},
                    {label: this.$t('in.captureby'), prop: "captureby"},
                    {label: this.$t('in.grossweight'), prop: "etweight"},
                    {label: this.$t('in.validateflag'), prop: "validateflag"},
                    {label: this.$t('in.wgt'), prop: "wgt"},
                    {label: this.$t('in.iother',{no:1}), prop: "iother1"},
                    {label: this.$t('in.iother',{no:2}), prop: "iother2"},
                    {label: this.$t('in.iother',{no:3}), prop: "iother3"},
                    {label: this.$t('in.iother',{no:4}), prop: "iother4"},
                    {label: this.$t('in.iother',{no:5}), prop: "iother5"},
                    {label: this.$t('in.serialnumberlong'), prop: "serialnumberlong"},
                ],
                tableData: [],
                pageSize: 10,
              page: 1,
                total: 10,
            }
        },
        methods: {
            async getTableData(page) {
                try {
                    let res = await this.$api.post(`/asn/detail/detailed/lotxidDetail/${page}`, {
                        sourcekey: this.data.argument.receiptkey,
                        sourcelinenumber: this.data.detailData.receiptlinenumber,
                    });
                    
                        this.tableData = res.page.list;
                      this.page = res.page.curPage;
                        this.pageSize = res.page.pageSize;
                        this.total = res.page.total;
                } catch (e) {
                    this.$message.error(e);
                }
            },
        },
        mounted() {
            this.getTableData(1);
        },
        watch: {},
        components: {
            'v-table': table
        }
    }
</script>

<style scoped>

</style>
